<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="${rootpath }/back/finan/assetList.html"
		method="post">
		<input type="hidden" name="usersid" value="${param.usersid }">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>
						关键字：
						<input type="text" name="keyword" value="${requestScope.keyword }"/>
						状态:
						<select name="statusList" class="required">
							<option value="">请选择</option>
							<option value="1" ${requestScope.statusList == '1' ? 'selected' : '' }>启用</option>
							<option value="0" ${requestScope.statusList == '0' ? 'selected' : '' }>禁用</option>
						</select>
						币种：
						<select name="coinid" class="required">
							<option value="">请选择</option>
							<c:forEach items="${requestScope.coinrateList }" var="coinrate" varStatus="stat">
								<option value="${coinrate.id }" ${requestScope.coinid == coinrate.id ? 'selected' : '' }>${coinrate.name }</option>
							</c:forEach>
						</select>
					</td>
				</tr>
			</table>
			<div class="subBar">
				<table class="searchContent">
					<td>
						更新时间：
						<input type="text" name="st" value="${requestScope.st }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true" />
						<input type="text" name="ed" value="${requestScope.ed }" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true" />
					</td>
					<td align="right">
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</td>
				</table>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li>
				<a class="edit" href="${rootpath }/back/finan/assetSync.html"
					 target="ajaxTodo" ref="assetSync" title="确认执行此操作吗?"><span>同步账户</span></a>
			</li>
			<li>
				<a class="edit" href="${rootpath }/back/finan/assetResetPercent.html"
					 target="ajaxTodo" ref="assetSync" title="确认执行此操作吗?"><span>重新计算</span></a>
			</li>
			<li>
				<a class="edit" href="${rootpath }/back/finan/assetInsert.html?usersid=${param.usersid}"
					 target="navTab" ref="assetInsert"><span>添加资产</span></a>
			</li>
			<li>
				<a class="edit" href="${rootpath }/back/finan/assetUpdate.html?assetId={sid_user}"
					 target="navTab" ref="assetUpdate"><span>修改资产</span></a>
			</li>
			<li>
				<a class="edit" href="${rootpath }/back/finan/assetUpdate.html?assetId={sid_user}"
					 target="navTab" ref="assetInfo"><span>查看</span></a>
			</li>
			<li>
				<a class="edit" href="${rootpath }/back/finan/historyList.html?assetId={sid_user}"
					 target="navTab" ref="historyList"><span>查看资产历史</span></a>
			</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="40">序号</th>
				<th width="40">id</th>
				<th width="100">用户</th>
				<th width="60">币种</th>
				<th width="60">余额</th>
				<th width="60">usdt</th>
				<th width="60">比例</th>
				<th width="80">今日收益(usdt)</th>
				<th width="80">总收益(usdt)</th>
				<th width="80">总收益(rmvb)</th>
				<th width="60">状态</th>
				<th width="117">创建时间</th>
				<th width="117">更新时间</th>
				<th width="117">发布时间</th>
			</tr>
		</thead>
		<tbody>
			<c:set value="0" var="totalPercent"/>
			<c:forEach items="${requestScope.assetList }" var="asset" varStatus="stat">
				<c:set value="${totalPercent + asset.percent }" var="totalPercent"/>
				<tr target="sid_user" rel="${asset.id }">
					<td>${stat.count }</td>
					<td>${asset.id }</td>
					<td>
						${asset.users.email}
					</td>
					<td>${asset.coinrate.name}</td>
					<td>${asset.balance }</td>
					<td>${asset.usdBalance }</td>
					<td><fmt:formatNumber value="${asset.percent }" pattern="#.###%"/></td>
					<td>${asset.todayPrift }</td>
					<td>${asset.totalPrift }</td>
					<td>${asset.cnyPrift }</td>
					<td>${asset.statusStr }</td>
					<td><fmt:formatDate value="${asset.createtime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td><fmt:formatDate value="${asset.updatetime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td><fmt:formatDate value="${asset.pubtime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				</tr>
			</c:forEach>
			<tr target="sid_user" rel="">
				<td></td>
				<td></td>
				<td>
					
				</td>
				<td></td>
				<td></td>
				<td></td>
				<td><fmt:formatNumber value="${totalPercent}" pattern="#.###%"/></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
			</tr>
		</tbody>
	</table>
	<form onsubmit="return navTabSearch(this);" id="pageFormAssetList" method="post" action="${rootpath }/back/finan/assetList.html">
		<input type="hidden" name="keyword" value="${requestScope.keyword }">
		<input type="hidden" name="statusList" value="${requestScope.statusList }">
		<input type="hidden" name="st" value="${requestScope.st }">
		<input type="hidden" name="ed" value="${requestScope.ed }">
		<input type="hidden" name="usersid" value="${requestScope.usersid }">
		<input type="hidden" name="coinid" value="${requestScope.coinid }">
		<div class="panelBar">
			<ul style="float: right;">
				<li>
					<a class="button" onclick="return pageFormSubmit('pageFormAssetList','1','currentPage','${requestScope.pageInfo.pageSize}','pageSize')" href="#"><span>首页</span></a>
				</li>
				<li>
					<a class="button" onclick="return pageFormSubmit('pageFormAssetList','${requestScope.pageInfo.prePage}','currentPage','${requestScope.pageInfo.pageSize}','pageSize')" href="#"><span>上一页</span></a>
				</li>
				<li>
					<a class="button" onclick="return pageFormSubmit('pageFormAssetList','${requestScope.pageInfo.nextPage}','currentPage','${requestScope.pageInfo.pageSize}','pageSize')" href="#"><span>下一页</span></a>
				</li>
				<li>
					<a class="button" onclick="return pageFormSubmit('pageFormAssetList','${requestScope.pageInfo.totalPage}','currentPage','${requestScope.pageInfo.pageSize}','pageSize')" href="#"><span>末页</span></a>
				</li>
				<li>
					第<input type="text" id="currentPage" name="currentPage" value="${requestScope.pageInfo.currentPage}" size="5" maxlength="5" class="textInput">页,
					每页<input type="text" id="pageSize" name="pageSize" value="${requestScope.pageInfo.pageSize}" size="5" maxlength="5" class="textInput">条
					共${requestScope.pageInfo.totalRecord}条,共${requestScope.pageInfo.totalPage}页
					<input type="submit" onclick="" value="GO">
				</li>
			</ul>
		</div>
	</form>
</div>